package cn.oa.dao;

import cn.oa.entity.Position;
import cn.oa.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.junit.Test;

import java.sql.SQLException;
import java.util.List;

public class PositionText {
    SqlSessionFactory sqlSessionFactory = MybatisUtil.sessionFactory;
    SqlSession sqlSession = sqlSessionFactory.openSession();
    @Test
    public void getAllPositions() throws SQLException {
       List<Position> list= sqlSession.getMapper(PositionDao.class).getAllPositions();
        for (Position position:list){
            System.out.println(position);
        }
        sqlSession.close();
    }
}
